package com.yixin.hospital.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum CardTypeEnum {

    DISCOUNT_CARD(1, "折扣卡"),
    LIMIT_DATE_CARD(2, "期限卡"),
    STORED_CARD(3, "储值卡"),
    ;

    private Integer code;
    private String desc;


    public static String getDesc(int code) {
        for (CardTypeEnum cardTypeEnum : CardTypeEnum.values()) {
            if (cardTypeEnum.getCode() == code) {
                return cardTypeEnum.getDesc();
            }
        }
        return "";
    }
}
